from django.urls import path, re_path
from rest_framework_simplejwt.views import TokenObtainPairView, TokenRefreshView, TokenVerifyView

from home.ask import AskAPIView
from home.views import CreateUserAPIView, HealthCategoryView, HealthCategorySubView, HealthCategorySubView1, \
    HealthCategorySubView2, HospitalListApiView, DepartmentListApiView, DoctorListApiView, UserQuestionListApiView, \
    DoctorResponseListApiView, MedicineListApiView, DoctorListByDepartmentApiView, DoctorHospitalDepartmentMedicineView, \
    HospitalListByDepartmentApiView, UserRegisterAPIView, SmsCodeAPIView, VideosListApiView, PatientCreateAPIView

urlpatterns = [
    path('access_token/', TokenObtainPairView.as_view()),
    path('refresh/', TokenRefreshView.as_view()),
    path('verify/', TokenVerifyView.as_view()),
    path('create/', CreateUserAPIView.as_view()),
    path('create/', UserRegisterAPIView.as_view()),  # 注册用户
    re_path(r"^sms/(?P<phone>1[3-9]\d{9})/$", SmsCodeAPIView.as_view()),  # 发送短信验证码
    path('health_info_category/', HealthCategoryView.as_view()),  # 问医生9个分类
    path('health_category/', HealthCategorySubView.as_view()),  # 大健康和生活手册
    path('health_category_one/', HealthCategorySubView1.as_view()),  # 大健康和生活手册-一级类
    path('health_category_two/', HealthCategorySubView2.as_view()),  # 大健康和生活手册-二级类
    path('hospital/', HospitalListApiView.as_view()),  # 医院列表
    path('department/', DepartmentListApiView.as_view()),  # 科室列表
    path('doctor/', DoctorListApiView.as_view()),  # 医生列表
    path('user_question/', UserQuestionListApiView.as_view()),  # 用户提问列表
    path('doctor_response/', DoctorResponseListApiView.as_view()),  # 医生回答列表
    path('medicine/', MedicineListApiView.as_view()),  # 药品列表
    path('doctor_by_department/', DoctorListByDepartmentApiView.as_view()),  # 根据科室查询医生
    path('doctor_hospital_department_medicine/', DoctorHospitalDepartmentMedicineView.as_view()),
    # 将医生-医院-科室-药品的多对多关系建立起来
    path('department_by_hospitall/', HospitalListByDepartmentApiView.as_view()),  # 根据科室查医院
    path('video/', VideosListApiView.as_view()),
    path("create_patient/", PatientCreateAPIView.as_view()),
    # def ask(view):
    path('xx/', AskAPIView.as_view()),
]
